package com.ruoyi.bole.mapper;

import java.util.List;
import com.ruoyi.bole.domain.BoleEventRegistration;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

/**
 * 活动报名Mapper接口
 * 
 * @author WuJiale
 * @date 2025-03-23
 */
public interface BoleEventRegistrationMapper 
{
    //查询报名信息

    @Select("SELECT " +
            "contact, " +
            "email, " +
            "gender, " +
            "grade, " +
            "major, " +
            "real_name AS realName, " +  // 使用别名
            "reg_status AS regStatus, " +
            "reg_time AS regTime ,remark,create_time AS createTime, " +
            "reg_id As regId  " +
            "FROM bole_event_registration " +
            "WHERE content_id = #{contentId} AND user_id = #{userId}")
    public BoleEventRegistration selectByContentIdAndUserId(
            @Param("contentId") Long contentId,
            @Param("userId") Long userId
    );
    /**
     * 查询活动报名
     * 
     * @param regId 活动报名主键
     * @return 活动报名
     */
    public BoleEventRegistration selectBoleEventRegistrationByRegId(Long regId);

    /**
     * 查询活动报名列表
     * 
     * @param boleEventRegistration 活动报名
     * @return 活动报名集合
     */
    public List<BoleEventRegistration> selectBoleEventRegistrationList(BoleEventRegistration boleEventRegistration);

    /**
     * 新增活动报名
     * 
     * @param boleEventRegistration 活动报名
     * @return 结果
     */
    public int insertBoleEventRegistration(BoleEventRegistration boleEventRegistration);

    /**
     * 修改活动报名
     * 
     * @param boleEventRegistration 活动报名
     * @return 结果
     */
    public int updateBoleEventRegistration(BoleEventRegistration boleEventRegistration);

    /**
     * 删除活动报名
     * 
     * @param regId 活动报名主键
     * @return 结果
     */
    public int deleteBoleEventRegistrationByRegId(Long regId);

    /**
     * 批量删除活动报名
     * 
     * @param regIds 需要删除的数据主键集合
     * @return 结果
     */
    public int deleteBoleEventRegistrationByRegIds(Long[] regIds);
}
